package com.irdstudio.efp.flow.service.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.irdstudio.efp.flow.service.domain.BizFlowProcess;
import com.irdstudio.efp.flow.service.vo.BizFlowProcessVO;
/**
 * <p>DAO interface:业务流转过程配置				<p>
 * @author ligm
 * @date 2018-05-05
 */
public interface BizFlowProcessDao {
	
	public int insertBizFlowProcess(BizFlowProcess bizFlowProcess);
	
	public int deleteByPk(BizFlowProcess bizFlowProcess);
	
	public int deleteByBizFlowID(BizFlowProcess bizFlowProcess);
	
	public int deleteByFlowIdAndEventId(BizFlowProcess bizFlowProcess);
	
	public int updateByPk(BizFlowProcess bizFlowProcess);
	
	public BizFlowProcess queryByPk(BizFlowProcess bizFlowProcess);
	
	public List<BizFlowProcess> queryAllOwnerByPage(BizFlowProcessVO bizFlowProcess);
	
	public List<BizFlowProcess> queryAllCurrOrgByPage(BizFlowProcessVO bizFlowProcess);
	
	public List<BizFlowProcess> queryAllCurrDownOrgByPage(BizFlowProcessVO bizFlowProcess);
	
	public BizFlowProcess queryFirstByEventAndNodeId(BizFlowProcess bizFlowProcess);
	
	public BizFlowProcess queryDefaultByEventAndFlowId(BizFlowProcess bizFlowProcess);
	
	/**
	 * 查询流转配置中事件下配置的所有节点
	 * @param bizFlowProcess
	 * @return
	 */
	public List<BizFlowProcess> queryAllByEventIdAndFlowId(BizFlowProcess bizFlowProcess);
	
	/**
	 * 根据业务流程ID查询
	 * @param bizFlowId
	 * @return
	 */
	public List<BizFlowProcess> queryBizFlowProcessByBizFlowId(@Param("bizFlowId") String bizFlowId);
	
	/**
	 * 批量插入
	 * @param list
	 * @return
	 */
	public int batchInsertBizFlowProcess(@Param("list") List<BizFlowProcess> list);
	
	/**
	 * 获取两个流程不同的业务流转过程配置
	 * @param srcBizFlowId
	 * @param targetBizFlowId
	 * @return
	 */
	public List<BizFlowProcess> queryDiffProcessFromTwoBizFlow(@Param("srcBizFlowId") String srcBizFlowId, @Param("targetBizFlowId") String targetBizFlowId);
}
